class ChatItem extends eui.Component {
    public clickey: number = 0;

    public constructor() {
        super();

        this.addEventListener(eui.UIEvent.COMPLETE, this.onComplete, this);

        this.skinName = "ChatItemSkin";

        this.touchChildren = true;
    }

    public lab_content: eui.Label;

    onComplete() {

    }

    createChildren() {
        super.createChildren();

        this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onClick, this);
    }

    private onClick(e: egret.TouchEvent): void {
        if (gameManager.chatTime > 0) {
            EffectTextUtils.showTips("你发言频率太快了！", 5);
            return;
        }

        gameManager.chatTime = GameConst.Time_ChatSpace;

        gameManager.socketManager.send(25, {
            type: 1,
            chat: {
                id: this.clickey,
                sex: game.player.sex,
                uid: game.player.uid
            }
        });

        gameManager.close('ChatPanel');
    }
}